<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title>XML source view</title><link rel="stylesheet" type="text/css" href="../xmlverbatim.css" /></head><body class="xmlverb-default"><tt>
<!-- converted by xmlverbatim.xsl 1.1, (c) O. Becker -->
<div xmlns:xd="http://www.pnp-software.com/XSLTdoc" class="xmlverb-default">&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e1">stylesheet</a></span><span class="xmlverb-ns-name"> xmlns:xs</span>="<span class="xmlverb-ns-uri">http://www.w3.org/2001/XMLSchema</span>"<span class="xmlverb-ns-name"> xmlns:util</span>="<span class="xmlverb-ns-uri">http://www.pnp-software.com/util</span>"<span class="xmlverb-ns-name"> xmlns:xd</span>="<span class="xmlverb-ns-uri">http://www.pnp-software.com/XSLTdoc</span>"<span class="xmlverb-ns-name"> xmlns:xsl</span>="<span class="xmlverb-ns-uri">http://www.w3.org/1999/XSL/Transform</span>" <span class="xmlverb-attr-name">version</span>="<span class="xmlverb-attr-content">2.0</span>"&gt;<span class="xmlverb-text"><br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e3">doc</a></span> <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">stylesheet</span>"&gt;<span class="xmlverb-text"><br />
    Utility functions used by other stylesheets.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e5">author</a></span>&gt;<span class="xmlverb-text">ibirrer</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">author</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e8">cvsId</a></span>&gt;<span class="xmlverb-text">$Id: util.xsl 24 2005-01-04 10:13:06Z ibirrer $</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">cvsId</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e11">copyright</a></span>&gt;<span class="xmlverb-text">2004, P&amp;amp;P Software GmbH</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">copyright</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;!--<span class="xmlverb-comment"> ********************************************************************** </span>--&gt;<span class="xmlverb-text"><br />
  </span>&lt;!--<span class="xmlverb-comment"> ***************************** Functions ****************************** </span>--&gt;<span class="xmlverb-text"><br />
  </span>&lt;!--<span class="xmlverb-comment"> ********************************************************************** </span>--&gt;<span class="xmlverb-text"><br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e21">doc</a></span>&gt;<span class="xmlverb-text">Extracts the folder part of an URI.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e25">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:getFolder</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e27">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e29">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace($uri, '(.*/)([^/]*)', '$1')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e32">doc</a></span>&gt;<span class="xmlverb-text">Extracts the filename of an URI.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e35">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:getFile</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e37">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e39">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace($uri, '(.*/)([^/]*)', '$2')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e42">doc</a></span>&gt;<span class="xmlverb-text">Get the shared path of two folders. If no shared path is found the empty string is returned.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e45">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:getSharedPath</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e47">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">folder1</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e49">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">folder2</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e51">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">folder1Norm</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:normalizeFolder($folder1)</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e53">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">folder2Norm</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:normalizeFolder($folder2)</span>" /&gt;<span class="xmlverb-text"><br />
 <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e55">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e57">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">$folder2Norm = ''</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e59">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">''</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e62">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">contains($folder1Norm, $folder2Norm)</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e64">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$folder2Norm</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e67">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e69">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:getSharedPath($folder1Norm, replace( $folder2Norm, '(.*/)([^/]*)/', '$1' ))</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
<br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e74">doc</a></span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e76">short</a></span>&gt;<span class="xmlverb-text">Transforms a filesystem path to a URI. </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">short</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e79">detail</a></span>&gt;<span class="xmlverb-text"><br />
            Backward slashes are transformed to forward slashes and the <br />
            prefix </span>&lt;<span class="xmlverb-element-name"><a name="d25e81">code</a></span>&gt;<span class="xmlverb-text">file:/</span>&lt;/<span class="xmlverb-element-name">code</span>&gt;<span class="xmlverb-text"> is added, if the goven path is an absoulte path. <br />
            If the argument is already a URI, it is left unchanged.<br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">detail</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e85">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">path</span>"&gt;<span class="xmlverb-text">The Path to be transformed as a string</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e90">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:pathToUri</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e92">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">path</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e94">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">pathTmp</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace($path, '\\', '/')</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e96">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">if(contains($pathTmp, 'file:/')) then $pathTmp else if( util:isAbsolutePath($pathTmp) ) then if (starts-with($pathTmp, '/')) then concat('file:', $pathTmp) else concat('file:/', $pathTmp) else $pathTmp</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">sequence</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e100">doc</a></span>&gt;<span class="xmlverb-text"> Replaces triple slashes '///' by a single slash. </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e102">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>"&gt;<span class="xmlverb-text">The uri to be normalized.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e106">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:normalizeUri</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e108">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e110">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace($uri, '///', '/')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e113">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Tests if a the given path describes an absolute path.<br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e116">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:isAbsolutePath</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:boolean</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e118">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">path</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e120">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">if( starts-with( $path,'/' ) or contains( $path, ':') ) then true() else false()</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e123">doc</a></span>&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e125">short</a></span>&gt;<span class="xmlverb-text"><br />
                  If the uri does not end with a slash, a slash is added at the end.<br />
          </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">short</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e128">detail</a></span>&gt;<span class="xmlverb-text"><br />
            Otherwise the uri is left unchanged. <br />
            The result is normalized with </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e130">see</a></span> <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">templates</span>"&gt;<span class="xmlverb-text">normalizeUri</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">see</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">detail</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e134">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>"&gt;<span class="xmlverb-text">An uri that points to a folder.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e139">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:normalizeFolder</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e141">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">uri</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e143">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:normalizeUri(if (ends-with($uri, '/')) then $uri else concat($uri, '/'))</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e146">doc</a></span>&gt;<span class="xmlverb-text"> <br />
          Returns the relative link of a given folder resolved to another folder. <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e148">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">from</span>"&gt;<span class="xmlverb-text">An absolute URI of a folder</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e151">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">to</span>"&gt;<span class="xmlverb-text">An absolute URI of a folder</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e155">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:getRelativeUri</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e157">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">from</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e159">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">to</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e161">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">fromNorm</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:normalizeFolder($from)</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e163">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">toNorm</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:normalizeFolder($to)</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e165">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">sharedPath</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:getSharedPath($fromNorm, $toNorm)</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e168">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">return</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e170">choose</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e172">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">string-length( $sharedPath ) = string-length( $fromNorm )</span>"&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e174">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">substring( $toNorm, string-length($fromNorm) + 1 )</span>" /&gt;<span class="xmlverb-text"><br />
        </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e177">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e179">for-each</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">tokenize(substring( $fromNorm, string-length($sharedPath) + 1 ), '/')</span>"&gt;<span class="xmlverb-text"><br />
            </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e181">if</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">position() != last()</span>"&gt;<span class="xmlverb-text"><br />
              </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e183">text</a></span>&gt;<span class="xmlverb-text">../</span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">text</span>&gt;<span class="xmlverb-text"><br />
            </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">if</span>&gt;<span class="xmlverb-text"><br />
          </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">for-each</span>&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e188">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">substring( $toNorm, string-length($sharedPath) + 1 )</span>" /&gt;<span class="xmlverb-text"><br />
        </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">variable</span>&gt;<span class="xmlverb-text"><br />
                 </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e193">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$return</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e196">doc</a></span>&gt;<span class="xmlverb-text"> <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e198">short</a></span>&gt;<span class="xmlverb-text">Builds realive link between to files</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">short</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e201">detail</a></span>&gt;<span class="xmlverb-text"><br />
      Like </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e203">link</a></span> <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">xsl:function</span>"&gt;<span class="xmlverb-text">util:getRelativeUri</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">link</span>&gt;<span class="xmlverb-text">, <br />
      but the arguments are two abslute files URI instead of folders. The <br />
      filename is taken from the first argument.<br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">detail</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e207">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">from</span>"&gt;<span class="xmlverb-text">An absolute URI of a file</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e210">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">to</span>"&gt;<span class="xmlverb-text">An absolute URI of a file</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e214">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:getRelativeUriFiles</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e216">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">from</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e218">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">to</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:string</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e220">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">reverse</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">xs:boolean</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e222">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e224">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">not(util:isAbsolutePath($from))</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e226">message</a></span> <span class="xmlverb-attr-name">terminate</span>="<span class="xmlverb-attr-content">yes</span>"&gt;<span class="xmlverb-text">Error in util:getRelativeUriFiles(). $from must be an absolute URI but is: </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e228">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$from</span>" /&gt;&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">message</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e231">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">not(util:isAbsolutePath($to))</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e233">message</a></span> <span class="xmlverb-attr-name">terminate</span>="<span class="xmlverb-attr-content">yes</span>"&gt;<span class="xmlverb-text">Error in util:getRelativeUriFiles(). $to must be an absolute URI but is: </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e235">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$to</span>" /&gt;&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">message</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
    <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e239">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e241">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">$reverse</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e243">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat(util:getRelativeUri(util:getFolder($to), util:getFolder($from)), util:getFile($from))</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e246">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e248">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat(util:getRelativeUri(util:getFolder($from), util:getFolder($to)), util:getFile($from))</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e253">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Returns the string after the last occurence of a given character.<br />
    If the given character is not found the text is returned without change.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e255">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>"&gt;<span class="xmlverb-text">The text from which to extarct the substring</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e258">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">token</span>"&gt;<span class="xmlverb-text">The character after which the text should be returned</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e263">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:substringAfterLast</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e265">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e267">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">token</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e269">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e271">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">contains( $text, $token )</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e273">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">regExpr</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat('(.*', $token,')([', $token, ']*)' )</span>" /&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e275">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace($text, $regExpr, '$2', 's')</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e280">doc</a></span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e283">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:fileSuffixToHtml</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e285">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">fileUri</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e287">sequence</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat(substring-before( $fileUri, '.xml' ),'.html')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e290">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Appends an element to another element.<br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e293">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:appendElement</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">element()</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e295">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">container</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">element()</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e297">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">element</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">element()</span>" /&gt;<span class="xmlverb-text"><br />
    <br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e299">element</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">{node-name($container)}</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e301">copy-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$container/@*</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e303">copy-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$container/*</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e305">copy-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$element</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">element</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e309">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Repeats a string several times.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e311">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The string to repeat</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e314">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">count</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">int</span>"&gt;<span class="xmlverb-text">how many times should the string be repeated</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e319">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:repeatString</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e321">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e323">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">count</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e325">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e327">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">string-length($text) = 0 or $count &amp;lt;= 0</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e329">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e331">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat($text, util:repeatString($text, $count - 1))</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text">  <br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e336">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Strips all xml elements and comments from a set of nodes and returns only the text nodes.<br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e339">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:stripXML</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e341">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">nodes</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e343">apply-templates</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$nodes</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">stripXML</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e346">doc</a></span>&gt;<span class="xmlverb-text">Helper template for stripXML function. Output all text nodes</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e349">template</a></span> <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">text()</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">stripXML</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e351">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">.</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">template</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e354">doc</a></span>&gt;<span class="xmlverb-text">Helper template for stripXML function. Do not output elements, but process subelements</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e358">template</a></span> <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">*</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">stripXML</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e360">apply-templates</a></span> /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">template</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e363">doc</a></span>&gt;<span class="xmlverb-text">Helper template for stripXML function. Delete all XML comments</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e366">template</a></span> <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">comment()</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">stripXML</span>" /&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e368">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Transforms an XML structure to a plain string.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e370">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">xml</span>"&gt;<span class="xmlverb-text">XML Element. Can also be a sequence of elements. </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e374">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:xmlToString</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e376">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">xml</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">item()*</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e378">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">return</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e380">apply-templates</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$xml</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToString</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">variable</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e383">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">string-join($return,'')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e386">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Helper template for xmlToString function.<br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e388">private</a></span> /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e392">template</a></span> <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">*</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToString</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e394">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat('&amp;lt;', name(.))</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e396">for-each</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">@*</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e398">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat(name(.),'=','&amp;quot;',. ,'&amp;quot;',' ')</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">for-each</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e401">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">'&amp;gt;'</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e403">apply-templates</a></span> <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToString</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e405">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat('&amp;lt;/', name(.),'&amp;gt;')</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">template</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e408">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:xmlToHtml</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">item()*</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e410">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">xml</span>" <span class="xmlverb-attr-name">as</span>="<span class="xmlverb-attr-content">item()*</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e412">apply-templates</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$xml[not( self::text() and (position() = 1 or position() = last()) )]</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToHtml</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e415">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Helper template for xmlToHtml function.<br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e417">private</a></span> /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e420">template</a></span><span class="xmlverb-ns-name"> xmlns</span>="<span class="xmlverb-ns-uri">http://www.w3.org/1999/xhtml</span>" <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">*</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToHtml</span>" <span class="xmlverb-attr-name">exclude-result-prefixes</span>="<span class="xmlverb-attr-content">#all</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-name"><a name="d25e422">span</a></span> <span class="xmlverb-attr-name">style</span>="<span class="xmlverb-attr-content">color: #990000</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e424">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat('&amp;lt;', name(.))</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e426">for-each</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">@*</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e428">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat(' ', name(.),'=','&amp;quot;',. ,'&amp;quot;')</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">for-each</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e431">choose</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e433">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">count(node()) = 0</span>"&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e435">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">'/&amp;gt;'</span>" /&gt;<span class="xmlverb-text"><br />
        </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e438">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e440">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">'&amp;gt;'</span>" /&gt;<span class="xmlverb-text"><br />
            </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e442">apply-templates</a></span> <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToHtml</span>" /&gt;<span class="xmlverb-text"><br />
          </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e444">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">concat('&amp;lt;/', name(.),'&amp;gt;')</span>" /&gt;<span class="xmlverb-text"><br />
        </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
      <br />
    </span>&lt;/<span class="xmlverb-element-name">span</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">template</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e450">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Helper template for xmlToHtml function.<br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e452">private</a></span> /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e455">template</a></span><span class="xmlverb-ns-name"> xmlns</span>="<span class="xmlverb-ns-uri">http://www.w3.org/1999/xhtml</span>" <span class="xmlverb-attr-name">match</span>="<span class="xmlverb-attr-content">text()</span>" <span class="xmlverb-attr-name">mode</span>="<span class="xmlverb-attr-content">xmlToHtml</span>" <span class="xmlverb-attr-name">exclude-result-prefixes</span>="<span class="xmlverb-attr-content">#all</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-name"><a name="d25e457">span</a></span> <span class="xmlverb-attr-name">style</span>="<span class="xmlverb-attr-content">color:black; font-weight:bold</span>"&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e459">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">.</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-name">span</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">template</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e464">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Removes all indentation from each line of a text.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e466">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The text the indentation should be added to.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e470">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:removeTextIndent</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e472">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;!--<span class="xmlverb-comment"> Use flag 'm' for multi-line mode </span>--&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e476">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace( $text, '^\s', '', 'm' )</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e479">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Removes specific indentation from each line of a text.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e481">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The text the indentation should removed from.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e484">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The indentation to be removed.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e488">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:removeTextIndent</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e490">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e492">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;!--<span class="xmlverb-comment"> Use flag 'm' for multi-line mode </span>--&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e496">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace( $text, concat('^', $indent), '', 'm' )</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e499">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Adds indentation to each line of a text.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e501">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The text the indentation should be added to.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e504">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">String that is used for indentation. </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e508">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:indentText</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e510">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e512">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e514">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">util:indentText( $text, $indent, true() )</span>" /&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
  <br />
  </span><div class="xd">
  &lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e518">doc</a></span>&gt;<span class="xmlverb-text"><br />
    Adds indentation to each line of a text.<br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e520">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">The text the indentation should be added to.</span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e523">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">string</span>"&gt;<span class="xmlverb-text">String that is used for indentation. </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name"><a name="d25e526">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indentFirstLine</span>" <span class="xmlverb-attr-name">type</span>="<span class="xmlverb-attr-content">boolean</span>"&gt;<span class="xmlverb-text">If true the first line is not indented </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">param</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xd</span>:<span class="xmlverb-element-name">doc</span>&gt;</div><span class="xmlverb-text"><br />
  </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e530">function</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">util:indentText</span>"&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e532">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">text</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e534">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indent</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e536">param</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">indentFirstLine</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;!--<span class="xmlverb-comment"> Use flag 'm' for multi-line mode </span>--&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e540">variable</a></span> <span class="xmlverb-attr-name">name</span>="<span class="xmlverb-attr-content">return</span>" <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">replace( $text, '^', $indent, 'm' )</span>" /&gt;<span class="xmlverb-text"><br />
    </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e543">choose</a></span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e545">when</a></span> <span class="xmlverb-attr-name">test</span>="<span class="xmlverb-attr-content">not($indentFirstLine)</span>"&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e547">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">substring( $return, string-length($indent) + 1 )</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">when</span>&gt;<span class="xmlverb-text"><br />
      </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e550">otherwise</a></span>&gt;<span class="xmlverb-text"><br />
        </span>&lt;<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name"><a name="d25e552">value-of</a></span> <span class="xmlverb-attr-name">select</span>="<span class="xmlverb-attr-content">$return</span>" /&gt;<span class="xmlverb-text"><br />
      </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">otherwise</span>&gt;<span class="xmlverb-text"><br />
    </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">choose</span>&gt;<span class="xmlverb-text"><br />
  </span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">function</span>&gt;<span class="xmlverb-text"><br />
</span>&lt;/<span class="xmlverb-element-nsprefix">xsl</span>:<span class="xmlverb-element-name">stylesheet</span>&gt;<br />
</div>
</tt><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />v
         </body></html>
